%code %include publicfunctions.inc %/include var AText: WideString; AProps, ASubs: TCatalogItemProps; AColls, ASubColls: TImageCollections; i, j: Integer; ASg: TSearchGroup; begin result := toWideString(''); AText := Utf8Decode(Request.Params.Values['text']); if AText = '' then AText := Request.Params.Values['text']; if AText = '' then begin result := result + 'no search text specified'; exit; end; if Request.Params.Values['labels'] = 'y' then begin result := result + '
';
AProps := TCatalogItemProps.Create(TCatalogItemProp, '');
//Catalog.FindPropsByName (AText, AProps, '', ssAnyPosition, True, -1, True);
ASg := TSearchGroup.Create(nil);
ASg.BuildFromText (AText, '');
for i := 0 to ASg.Items.Count - 1 do
begin
ASubs := TCatalogItemProps.Create(TCatalogItemProp, '');
Catalog.FindPropsByName (ASg.Items.Items[i].SearchValue, ASubs, '', ASg.Items.Items[i].SearchStyle, True, -1, True);
for j := 0 to ASubs.Count - 1 do
ASubs.Items[j].CopyTo (AProps, False);
ASubs.Free;
end;
ASg.Free;
Catalog.PathNameForProps (AProps, ' :: ', True);
AProps.Sort('PropName', stAscending);
if AProps.Count > 0 then
begin
for i := 0 to AProps.Count - 1 do
begin
result := result + '';
result := result + AProps.Items[i].Text;
result := result + '
';
end;
end
else
result := result + 'no catalog labels found for ' + AText;
AProps.Free;
result := result + '
';
AColls := TImageCollections.Create(TImageCollection, '');
ASg := TSearchGroup.Create(nil);
ASg.BuildFromText (AText, '');
for i := 0 to ASg.Items.Count - 1 do
begin
ASubColls := TImageCollections.Create(TImageCollection, '');
Catalog.FindCollectionsByName (ASg.Items.Items[i].SearchValue, AColls, ASg.Items.Items[i].SearchStyle);
for j := 0 to ASubColls.Count - 1 do
ASubColls.Items[j].CopyTo (AColls, False);
ASubColls.Free;
end;
ASg.Free;
AColls.Sort('CollectionName', stAscending);
if AColls.Count > 0 then
begin
for i := 0 to AColls.Count - 1 do
begin
AColls.Items[i].Text := Catalog.PathNameForCollection (AColls.Items[i], ' :: ');
result := result + '';
result := result + AColls.Items[i].Text;
result := result + '
';
end;
end
else
result := result + 'no portfolio collections found for ' + AText;
AColls.Free;
result := result + '